]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
enable reversed locale layout in QML
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 2 Feb 2022 13:01:37 +0000 (14:01 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 3 Dec 2024 10:49:37 +0000 (11:49 +0100)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/ResolveConflictsDialog.qml
src/gui/application.cpp
src/gui/filedetails/FileDetailsWindow.qml
src/gui/macOS/ui/FileProviderEvictionDialog.qml
src/gui/tray/CallNotificationDialog.qml
src/gui/tray/EditFileLocallyLoadingDialog.qml
src/gui/tray/MainWindow.qml

index a4b8474cd47f1338d6beb7dbd84d6345a07f49e7..e0d689b6bdfeb249dab799fc7ac688753f986f94 100644 (file)
@@ -30,6 +30,9 @@ ApplicationWindow {
     flags: Qt.Window | Qt.Dialog
     visible: true
 
+    LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft
+    LayoutMirroring.childrenInherit: true
+
     width: Style.minimumWidthResolveConflictsDialog
     height: Style.minimumHeightResolveConflictsDialog
     minimumWidth: Style.minimumWidthResolveConflictsDialog
index 9569c8bc1257c6a1c7360ef3e9d683e1d744e0c8..4b2f600afdaf7cd4743d3f809d242e26b1338c19 100644 (file)
@@ -101,7 +101,8 @@ namespace {
         "  --isvfsenabled             : whether to set a VFS or non-VFS folder (1 for 'yes' or 0 for 'no') when creating an account via command-line.\n"
         "  --remotedirpath            : (optional) path to a remote subfolder when creating an account via command-line.\n"
         "  --serverurl                : a server URL to use when creating an account via command-line.\n"
-        "  --forcelegacyconfigimport  : forcefully import account configurations from legacy clients (if available).\n";
+        "  --forcelegacyconfigimport  : forcefully import account configurations from legacy clients (if available).\n"
+        "  --reverse            : use a reverse layout direction.\n";
 
     QString applicationTrPath()
     {
@@ -814,6 +815,8 @@ void Application::parseOptions(const QStringList &options)
             _backgroundMode = true;
         } else if (option == QLatin1String("--version") || option == QLatin1String("-v")) {
             _versionOnly = true;
+        } else if (option == QLatin1String("--reverse")) {
+            setLayoutDirection(layoutDirection() == Qt::LeftToRight ? Qt::RightToLeft : Qt::LeftToRight);
         } else if (option.endsWith(QStringLiteral(APPLICATION_DOTVIRTUALFILE_SUFFIX))) {
             // virtual file, open it after the Folder were created (if the app is not terminated)
             QTimer::singleShot(0, this, [this, option] { openVirtualFile(option); });
index 2353498ad8db043bb255bff042c1767d1cc5f24b..f7f5eee41e42042215ea710a6b933414c7ffe57d 100644 (file)
@@ -26,6 +26,9 @@ ApplicationWindow {
     property var accountState
     property string localPath: ""
 
+    LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft
+    LayoutMirroring.childrenInherit: true
+
     width: 400
     height: 500
     minimumWidth: 300
index c62363b6593153971535df2cd343b5f1c143f9fa..5f96557ea910d406294fb26a9abb1b9c7d25a8db 100644 (file)
@@ -30,6 +30,9 @@ ApplicationWindow {
     property var materialisedItemsModel: null
     property string accountUserIdAtHost: ""
 
+    LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft
+    LayoutMirroring.childrenInherit: true
+
     title: qsTr("Evict materialised files")
     color: palette.base
     flags: Qt.Dialog | Qt.WindowStaysOnTopHint
index 3ebe3bd65c2f6216e5127aecbee11be73355e377..708882512aa8b0a3a88d48bbe3a640e9f7fd9087 100644 (file)
@@ -52,6 +52,9 @@ ApplicationWindow {
         Systray.destroyDialog(root);
     }
 
+    LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft
+    LayoutMirroring.childrenInherit: true
+
     width: root.windowWidth
     height: rootBackground.height
 
index 47dd20d09aa7731cfcab58bc75345751dc0761c7..8edbf8d01b635cbf55c56421eed5b118d1597318 100644 (file)
@@ -11,6 +11,9 @@ ApplicationWindow {
 
     color: palette.base
 
+    LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft
+    LayoutMirroring.childrenInherit: true
+
     width: 320
     height: contentLayout.implicitHeight
 
index 2a81a493e7fa8ed5f2b3e7fca7d49e0527ba8bda..c127d6db03a69c90fe9674cd016d96879c9c0c25 100644 (file)
@@ -31,6 +31,9 @@ import com.nextcloud.desktopclient
 ApplicationWindow {\r
     id:         trayWindow\r
 \r
+    LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft\r
+    LayoutMirroring.childrenInherit: true\r
+\r
     title:      Systray.windowTitle\r
     // If the main dialog is displayed as a regular window we want it to be quadratic\r
     width:      Systray.useNormalWindow ? Style.trayWindowHeight : Style.trayWindowWidth\r